using AutoMapper;
using BCVP.Net8.IService;
using BCVP.Net8.Model;
using BCVP.Net8.Model.ViewModel;
using BCVP.Net8.Service;
using Microsoft.AspNetCore.Mvc;

namespace BCVP.Net8.Controllers
{
    [ApiController]
    [Route("api/[controller]/[action]")]
    public class WeatherForecastController : ControllerBase
    {
        private static readonly string[] Summaries = new[]
        {
            "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
        };

        private readonly ILogger<WeatherForecastController> _logger;
        private readonly IBaseService<User, UserVM> _baseService;
        private readonly IMapper _mapper;

        public WeatherForecastController(ILogger<WeatherForecastController> logger,IBaseService<User,UserVM> baseService)
        {
            _logger = logger;
            this._baseService = baseService;
        }

        [HttpGet(Name = "GetWeatherForecast")]
        public async Task<List<UserVM>> Get()
        {
            var users = new UserService();
            return await users.Query();
        }

        [HttpGet]
        public async Task<List<UserVM>> Get1()
        {
            return await _baseService.Query();
        }
    }
}
